/**
 * @Mediator.as
 * 
 * @author sodaChen mail:asframe@163.com
 * @version 1.0
 * <br>Copyright (C), 2012 ASFrame.com
 * <br>This program is protected by copyright laws.
 * <br>Program Name:ASFrame AStruts2
 * <br>Date:2012-5-6
 */
package
{
	import com.asframe.astruts2.context.IAStrutsContext;

	/**
	 *
	 * @author sodaChen
	 * @Date:2012-5-6
	 */
	public class Mediator
	{
		//静态属性作为感兴趣的通知
		[Notice]
		public static const NOTICE_1:String = "notice1";
		[Notice]
		public static const NOTICE_2:int = 2;
		
		//表示该对象为view
		[View]
		public var view:View;
		//默认的规则是会用view的名称来尝试匹配view对象
		public var viewName:View;
		
		//自动注入一个Bean对象
		[Ref("bean")]
		public var bean:Object;
		
		[Ref("context")]
		public var context:IAStrutsContext;
		
		
		public function Mediator()
		{
		}
		//被view直接呼叫的方法
		[ViewMethod]
		public function loginView(name:String,pass:String):void
		{
			
		}
		
		//自动注册为通知的观察者，主题名称为方法名
		[Notice]
		public function changeNameNotice(name:String):void
		{
			
		}
		//指定一个主题名，一般是建议方式方法名作为主题名，这样比较方便，也是相当于约定
		[Notice("heroInfo")]
		public function heroInfo(name:String,objInfo:Object):void
		{
			
		}
	}
}
